import request from "@/utils/request.ts";
import { ElMessage } from "element-plus";
// 上传文件
export const doUpload = (data: any) => {
  return request({
    url: "/upload",
    method: "post",
    data,
  })
    .then((res: any) => {
      if (res.code === 200) {
        // 文件链接
        return res.data;
      }
      ElMessage.error(res.message);
    })
    .catch((err: any) => {
      ElMessage.error(err.msg);
    });
};
